<template>
  <div class="search">
    <div class="input-wrapper">
      <input type="text" v-model="content" >
      <div class="searchBtn" @click="search"></div>
    </div>
  </div>
</template>
<script type="text/ecmascript-6" >
export default {
  data () {
    return {
      content: ''
    }
  },
  props: {
  },
  created() {
  },
  methods: {
    search() {
      if (this.content) {
        this.$emit('search', this.content)
      }
    }
  }
}
</script>

<style scoped lang="less">
  .search{
    position: relative;
    z-index: 10;
    width: 100%;
    height: 88px;
    background-color: #ffffff;
    padding: 0 20px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    .input-wrapper{
      position: relative;
      width: 100%;
      height: 50px;
      border-radius: 8px;
      box-sizing: border-box;
      padding:0 55px 0 20px; 
      background-color: #f2f2f2;
      input{
        outline: none;
        background-color: transparent;
        border: none;
        width: 100%;
        height: 100%;
        line-height: 50px;
        font-size: 22px;
        color: #333;
      }
      .searchBtn{
        position: absolute;
        z-index: 8;
        top: 0;
        right: 18px;
        width: 33px;
        height: 100%;
        background: url('../assets/image/icon_search.png') no-repeat center center / 33px 33px;
      }
    }
  }
</style>
